home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Toolbox / Visual Basic Toolbox (P.I.E.)(1996).ISO / tpascal / bpvbx / vbapi_.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1994-02-02  |  34.3 KB  |  1,064 lines

  1. {$R-,K-,S-}
  2. UNIT VBAPI_; {Visual Basic Custom Control API}
  3. INTERFACE
  4.   USES WINPROCS,
  5.        WINTYPES;
  6.  
  7. CONST
  8.     VB100_VERSION    =    $0100;
  9.     VB200_VERSION    =    $0200;
  10.     VB_VERSION        =    VB200_VERSION;
  11.  
  12.  
  13. {General types and modifiers}
  14.  
  15. TYPE BOOL       = WordBool;
  16.      Enum       = Byte;
  17.      LPStr      = PChar;
  18.      Hsz        = LPHandle;
  19.      PHSZ       = ^HSZ;
  20.      HLStr      = LPHandle;
  21.      HCtl       = LPHandle;
  22.      HAD        = LPHandle;
  23.      HFormFile  = PHandle;
  24.      ERR        = Word;
  25.      HPic       = Word;
  26.      Float      = Single;
  27.      ULONG      = Longint;
  28.      USHORT     = Word;
  29.  
  30.  
  31. TYPE tOffset = Word; {offset for near pointers}
  32.  
  33. {language Variant structures}
  34.  
  35. {variant TYPE constants. these are the return value of GetVariantType.}
  36. {these are also defined in Constant.Txt for return value of VarType()}
  37. CONST vt_EMPTY    =0 ;  {     Empty}
  38.       vt_NULL     =1 ;  {     Null}
  39.       vt_I2          =2 ;  {     Integer}
  40.       vt_I4          =3 ;  {     Long}
  41.       vt_R4          =4 ;  {     Single}
  42.       vt_R8          =5 ;  {     Double}
  43.       vt_CURRENCY =6 ;  {     Currency}
  44.       vt_DATE     =7 ;  {     Date}
  45.       vt_STRING   =8 ;  {     String}
  46.  
  47. TYPE tVariantType = vt_EMPTY..vt_STRING;
  48.  
  49.  
  50. TYPE tCurrency = RECORD
  51.         lo  :Longint;
  52.         hi  :Longint;
  53.      END;
  54.  
  55.      pValue     = ^TValue;
  56.      tValue    = RECORD
  57.          case tVariantType of
  58.              vt_I2:(
  59.                 i2   :Integer
  60.                 );
  61.              vt_I4:(
  62.                 i4   :Longint
  63.                 );
  64.              vt_R4:(
  65.                 r4   :Single
  66.                 );
  67.              vt_R8:(
  68.                 r8   :Double
  69.                 );
  70.              vt_CURRENCY:(
  71.                 cy   :TCurrency
  72.                 );
  73.              vt_STRING:(
  74.                 hstr :HLStr
  75.                 );
  76.      END;
  77.  
  78.  
  79. {The size of Variant is needed when a Variant is passed by value}
  80. {or in a structure (user-defined TYPE).}
  81.  
  82.     PVariant   = ^TVariant;
  83.     TVariant = RECORD
  84.         v: array[0..15] of char;
  85.     end;
  86.  
  87. {COLOR - a Windows RGB DWORD value.}
  88. TYPE  Color=    TCOLORREF;
  89.       LPColor = ^Color;
  90.  
  91. {Property data structure}
  92. TYPE
  93.    TIndex = RECORD
  94.        datatype: Word;    {TYPE of nth index (Currently always dt_Integer)}
  95.        data:     Longint       {Value of nth index}
  96.    END;
  97.  
  98. TYPE TDataStruct = RECORD
  99.         data: Longint;        {Data for Get/Set}
  100.         cindex: Word;            {Number of indecies}
  101.         index : array[0..0]of TIndex
  102.     END;
  103.  
  104.     PDataStruct = ^TDataStruct;
  105.  
  106.  
  107. {VISUAL BASIC variable types}
  108. CONST
  109.     et_I2        =1 ;    {16 bit signed integer scalar or array variable}
  110.     et_I4        =2 ;    {32 bit signed integer scalar or array variable}
  111.     et_R4        =3 ;
  112.     et_R8        =4 ;    {64 bit real scalar or array variable}
  113.     et_CY        =5 ;    {64 bit currency scalar or array variable}
  114.     et_HLSTR    =6 ;      {string scalar or array variable}
  115.     et_SD        =6 ;    {older string scalar or array variable}
  116.     et_FS        =7 ;    {fixed-length string variable}
  117.  
  118.  
  119. {Control Property definitions and structures.}
  120. CONST
  121.     pf_datatype            =    $000000FF;
  122.     pf_fPropArray        =    $00000100;
  123.     pf_fSetData            =    $00000200;
  124.     pf_fSetMsg            =    $00000400;
  125.     pf_fNoShow            =    $00000800;
  126.     pf_fNoRuntimeW        =    $00001000;
  127.     pf_fGetData            =    $00002000;
  128.     pf_fGetMsg            =    $00004000;
  129.     pf_fSetCheck        =    $00008000;
  130.     pf_fSaveData        =    $00010000;
  131.     pf_fSaveMsg            =    $00020000;
  132.     pf_fLoadDataOnly    =   $20010000;
  133.     pf_fLoadMsgOnly     =   $20020000;
  134.     pf_fGetHszMsg        =    $00040000;
  135.     pf_fUpdateOnEdit    =    $00080000;
  136.     pf_fEditable        =    $00100000;
  137.     pf_fPreHwnd            =    $00200000;
  138.     pf_fDefVal            =    $00400000;
  139.     pf_fNoInitDef        =    $00800000;
  140.     pf_fNoRuntimeR        =   $02000000;
  141.     pf_fNoMultiSelect   =   $04000000;
  142.  
  143. TYPE  OfsPPROPINFO = tOffset;
  144.       pPropInfo = ^tPropInfo;
  145.       tPropInfo = RECORD
  146.           npszName    :tOffset;
  147.           fl          :Longint;            {pf_ flags}
  148.           offsetData: Byte;        {Offset into static structure}
  149.           infoData:    Byte;        {0 or _INFO value for bitfield}
  150.           dataDefault:     Longint;        {0 or _INFO value for bitfield}
  151.           npszEnumList:     tOffset;        {For TYPE == dt_ENUM, this is
  152.                            a near ptr to a string containing
  153.                            all the values to be displayed
  154.                            in the popup enumeration listbox.
  155.                            Each value is an sz, with an
  156.                            empty sz indicated the end of list.}
  157.           enumMax:    Byte;        {Maximum legal value for enum.}
  158.       END;
  159.  
  160. {Values for PROPINFO pf_datatype}
  161. CONST dt_HSZ          = $01;
  162.       dt_SHORT          = $02;
  163.       dt_Integer      = dt_SHORT;
  164.       dt_LONG         = $03;
  165.       dt_BOOL         = $04;
  166.       dt_COLOR        = $05;
  167.       dt_ENUM         = $06;
  168.       dt_REAL         = $07;
  169.       dt_XPOS         = $08;
  170.       dt_XSIZE        = $09;
  171.       dt_YPOS         = $0A;
  172.       dt_YSIZE        = $0B;
  173.       dt_PICTURE      = $0C;
  174.       dt_HLSTR        = $0D;
  175.       dt_OBJECT       =    $20;
  176.  
  177. {Control event definitions and structures.}
  178.  
  179.     ef_fNoUnload    =$00000001;
  180.  
  181. TYPE
  182.     pEventInfo = ^tEventInfo;
  183.     tEventInfo = RECORD
  184.         npszName        :tOffset;
  185.         cParms          :Word;      {# of parameters}
  186.         cwParms         :Word;        {# words of parameters}
  187.         npParmTypes     :tOffset;    {list of parameter types}
  188.         npszParmProf    :tOffset;    {event parameter profile string}
  189.         fl              :Longint;    {ef_ flags}
  190.     END;
  191.  
  192.     OfsPEVENTINFO = tOffset;
  193.  
  194.  
  195. {Structure for vbm_DRAGOVER and vbm_DRAGDROP events}
  196. TYPE
  197.     TDRAGINFO=RECORD
  198.         Control:     HCtl;
  199.         pt:            TPOINT;
  200.         state:         Word;    {Enter, Over, Exit; only used for vbm_DRAGOVER}
  201.     END;
  202.  
  203.     PDRAGINFO = ^TDRAGINFO;
  204.     NPDRAGINFO = tOffset;
  205.     LPDRAGINFO = ^TDRAGINFO;
  206.  
  207. CONST
  208.     drag_state_ENTER       =$00;
  209.     drag_state_EXIT        =$01;
  210.     drag_state_OVER        =$02;
  211.  
  212.  
  213. {Control MODEL structure}
  214.  
  215. TYPE
  216.     LPMODEL = ^TMODEL;
  217.     TModel=RECORD
  218.         usVersion:        Word;        {VB version used by control}
  219.         fl:                Longint;    {Bitfield structure}
  220.         ctlproc:        TFARPROC;    {the control proc.}
  221.         fsClassStyle:    Word;         {window class style}
  222.         flWndStyle:        Longint;    {default window style}
  223.         cbCtlExtra:        Word;        {# bytes alloc'd for HCtl structure}
  224.         idBmpPalette:    Word;        {BITMAP id for tool palette}
  225.         DefCtlName:     tOffset;        {PSTR;     {default control name prefix}
  226.         ClassName:        tOffset;        {PSTR;        {Visual Basic class name}
  227.         ParentClassName :tOffset;    {PSTR;    {Parent window class if subclassed}
  228.         proplist:        tOffset;        {Property list}
  229.         eventlist:        tOffset;        {Event list}
  230.         nDefProp:         Byte;        {index of default property}
  231.         nDefEvent:        Byte;        {index of default event}
  232.         nValueProp:        Byte;        {Index of control value property}
  233.     END;
  234.  
  235.  
  236.  
  237. CONST
  238.     model_fArrows        =$00000001;
  239.     model_fFocusOk        =$00000002;
  240.     model_fMnemonic     =$00000004;
  241.     model_fChildrenOk   =$00000008;
  242.     model_fInitMsg        =$00000010;
  243.     model_fLoadMsg        =$00000020;
  244.     model_fDesInteract  =$00000040;
  245.     model_fInvisAtRun   =$00000080;
  246.     model_fGraphical    =$00000100;
  247.  
  248. {MODELINFO structure}
  249. TYPE
  250.     LPModelInfo = ^TModelInfo;
  251.     TModelInfo    = RECORD
  252.         usVersion:    Word;
  253.         lplpmodel:    ^LPMODEL;
  254.     END;
  255.  
  256.  
  257. {Picture structure}
  258. CONST
  259.     pictype_NONE =        0;
  260.     pictype_BITMAP        =1;
  261.     pictype_METAFILE    =2;
  262.     pictype_ICON        =3;
  263.  
  264.     hpic_INVALID       =    $FFFF;
  265.     hpic_NULL        =0;
  266.  
  267. TYPE TPicVariant = RECORD
  268.         case  Integer of
  269.             pictype_BitMap   :  (
  270.                BitMap :HBitMap;
  271.                hpal   :HPalette
  272.                );
  273.             pictype_MetaFile :     (
  274.                Meta    :THandle;
  275.                xExt,
  276.                yExt    :Integer);
  277.             pictype_Icon     :    (
  278.                Icon   :HIcon
  279.                );
  280.     END;
  281.  
  282.     PPIC = ^TPIC;
  283.     TPIC = RECORD
  284.         picType:     Byte;
  285.         picVariant:    TPicVariant;
  286.         picReserved: array[1..4] of Byte;
  287.     END;
  288.  
  289. {Mode constants}
  290. CONST
  291.     mode_DESIGN    =1;
  292.     mode_RUN    =2;
  293.     mode_BREAK    =3;
  294.  
  295.  
  296. {Control flags for use with VBSetControlFlags}
  297. CONST
  298.     ctlflg_HASPALETTE              = $00000001;
  299.     ctlflg_USESPALETTE              = $00000002;
  300.     ctlflg_GRAPHICALOPAQUE          = $00000004;
  301.     ctlflg_GRAPHICALTRANSLUCENT   = $00000008;
  302.     ctlflg_DATACHANGED              = $00000010;
  303.     ctlflg_BOUNDDATASET              = $00000020;
  304.  
  305. {Bound control interface}
  306.  
  307. {values for the sAction parameter on vbm_DATA_GET messages.}
  308. CONST
  309.     data_FIELDVALUE      =0;
  310.     data_FIELDNAME         =1;
  311.     data_FIELDTYPE         =2;
  312.     data_FIELDSIZE         =3;
  313.     data_FIELDSCOUNT     =4;
  314.     data_FIELDCHUNK      =5;
  315.     data_FIELDPOSITION   =6;
  316.     data_FIELDATTRIBUTES =7;
  317.  
  318.     data_BOF         =16;
  319.     data_EOF         =17;
  320.     data_BOOKMARK         =18;
  321.     data_BOOKMARKABLE    =19;
  322.     data_UPDATABLE         =20;
  323.     data_RECORDCOUNT     =21;
  324.     data_LASTMODIFIED    =22;
  325.  
  326. {sAction values during vbm_data_AVAILABLE messages}
  327.  
  328.     data_MOVEFIRST          =64;
  329.     data_MOVENEXT          =65;
  330.     data_MOVEPREV          =66;
  331.     data_MOVELAST          =67;
  332.     data_FINDFIRST          =68;
  333.     data_FINDNEXT          =69;
  334.     data_FINDPREV          =70;
  335.     data_FINDLAST          =71;
  336.     data_DELETE          =72;
  337.     data_ADDNEW          =73;
  338.     data_REFRESH          =74;
  339.     data_ROLLBACK          =76;
  340.     data_CLOSE          =77;
  341.     data_DATAFIELDCHANGED =78;
  342.     data_SAVEDATA          =79;
  343.     data_READDATA          =80;
  344.     data_UPDATE          =81;
  345.     data_UNLOAD          =82;
  346.  
  347.  
  348. {return types for vbm_data_GET with sAction = data_FIELDTYPE}
  349.  
  350.     data_vt_BOOL       =1;
  351.     data_vt_VAR_BYTE   =2;
  352.     data_vt_INTEGER    =3;
  353.     data_vt_LONG       =4;
  354.     data_vt_CURRENCY   =5;
  355.     data_vt_SINGLE       =6;
  356.     data_vt_DOUBLE       =7;
  357.     data_vt_DATETIME   =8;
  358.     data_vt_TEXT       =10;
  359.     data_vt_BINARY       =11;
  360.     data_vt_MEMO       =12;
  361.  
  362. {vbm_DATA_GET with sAction = data_BOOKMARK fill in ldata with one of these}
  363.  
  364.     data_BOOKMARKFIRST      :Longint    = $80000000;
  365.     data_BOOKMARKPREV      :Longint    =    -1;
  366.     data_BOOKMARKCURRENT  :Longint    =    0;
  367.     data_BOOKMARKNEXT      :Longint    =    1;
  368.     data_BOOKMARKLAST      :Longint    =$7FFFFFFF;
  369.  
  370.  
  371.     da_fNull    =    $0001;
  372.     da_fBOF     =    $0002;
  373.     da_fEOF     =    $0004;
  374.  
  375.  
  376. {DA structure used for conversations with the data control}
  377. TYPE
  378.     LPDataAccess = ^TDataAccess;
  379.     TDataAccess = RECORD
  380.         usVersion:    Word;      {VB version of structure filled in when
  381.                              structure is created}
  382.         sAction:    Integer;{ on vbm_DATA_GET/SET specifies what to get/set
  383.                              on vbm_DATA_AVAILABLE/REQUEST tells why}
  384.         hctlData:    HCtl;    {the data control providing data}
  385.         hctlBound:    HCtl;          {the bound control receiving data}
  386.         hszDataField:    HSZ;       {the name of the field to get value of}
  387.         sDataFieldIndex: Integer; {the field index used when FieldName is null}
  388.         usDataType:    Word;          {the property datatype to convert data to}
  389.         hlstrBookMark: HLStr;      {used when getting multirow data}
  390.         fs:                Word;      {Bitfield structure}
  391.         lData:            Longint;  {the data}
  392.         ulChunkOffset:     Longint;  {  the offset to start at for GetChunk}
  393.         ulChunkNumBytes:Longint;  {  the number of bytes for GetChunk/SetChunk}
  394.     END;
  395.  
  396.  
  397. { General routines}
  398.  
  399. CONST color_DefBitOn = $80000000;    {bit set -> Win SysColor, not RGB}
  400. function rgbColor(Color: Longint):Longint;
  401. function vbGetMode: Word;
  402.  
  403.  
  404. {General control routines}
  405.  
  406. function vbDerefControl(Control: HCtl): Pointer;
  407. function vbDefControlProc(Control: HCtl;Wnd: tHandle;Msg: Word; WParam: Word; LParam: Longint): Longint;
  408. function vbRegisterModel(HMod: THandle ; var Model: TModel ): Bool;
  409.  
  410. function vbGetControlHwnd(Control: HCtl): tHandle;
  411. function vbGetHInstance: THandle;
  412. function vbGetControlModel(Control: HCtl): LPModel;
  413.  
  414. function vbGetControlName(Control: HCtl; lpszName: LPStr): LPStr;
  415. function vbGetHwndControl(Wnd: tHandle): HCtl;
  416. function vbSendControlMsg(Control: HCtl; Msg, WParam: Word; LParam: Longint): Longint;
  417.  
  418. function vbSuperControlProc(Control: HCtl; Msg, WParam: Word; LParam: Longint): Longint;
  419. function vbRecreateControlHwnd(Control: HCtl):Word;
  420. procedure vbDirtyForm(Control: HCtl);
  421.  
  422. function vbSetErrorMessage(error: Word; Str: LPStr): Word;
  423. procedure vbGetAppTitle(Str: LPStr; cbMax: Word);
  424. function vbDialogBoxParam(Instance: THandle; TemplateName: LPStr;DialogFunc: TFARPROC; lp: Longint):Integer;
  425.  
  426. {Management of dynamically allocated strings}
  427.  
  428. function vbCreateHsz(Control: HCtl; Str: LPStr): HSZ;                {Params changed}
  429.  
  430. procedure vbDestroyHsz(HSZStr: HSZ);
  431. function vbDerefHsz(HSZStr: HSZ): LPStr;
  432. function vbLockHsz(HSZStr: HSZ): LPStr;
  433. procedure vbUnlockHsz(HSZStr: HSZ);
  434.  
  435. {Management of language strings}
  436.  
  437. function vbCreateHlstr(pb: Pointer; cbLen: Word): HLStr;
  438. procedure vbDestroyHlstr(HStr: HLStr);
  439. function vbDerefHlstr(HStr: HLStr): LPStr;
  440. function vbGetHlstrLen(HStr: HLStr): Word;
  441. function vbSetHlstr(PHStr: Pointer; pb: Pointer; cbLen: Word): Word;
  442.  
  443. {Firing Basic event procedures}
  444.  
  445. function vbFireEvent(Control: HCtl; IdEvent: Word; LPParams: Pointer): Word;
  446.  
  447. {Control property access}
  448.  
  449. function vbGetControlProperty(Control: HCtl; IdProp: Word; pdata:Pointer): Word;
  450. function vbSetControlProperty(Control: HCtl; IdProp: Word; Data:Longint): Err;
  451.  
  452. {Picture management functions}
  453.  
  454. function vbAllocPic(PntPic: PPIC): HPic;
  455. procedure vbFreePic(Pic: HPic);
  456. function vbGetPic(Pic: HPic; PntPic: PPic): HPic;
  457. function vbPicFromCF(PntHPic: Pointer; HData: THandle; WFormat: Word): Word;
  458. function vbRefPic(Pic: HPic): HPic;
  459.  
  460. {File IO functions}
  461.  
  462. function vbReadFormFile(FormFile: HFormFile; pb: Pointer; cb: Word):Word;
  463. function vbWriteFormFile(FormFile: HFormFile; pb: Pointer; cb: Word):Word;
  464. function vbSeekFormFile(FormFile: HFormFile; OffSet: Longint): Longint;
  465. function vbRelSeekFormFile(FormFile: HFormFile; OffSet: Longint):Longint;
  466. function vbReadBasicFile(UsFileNo: Word; pb: Pointer; cb: Word):Word;
  467. function vbWriteBasicFile(UsFileNo: Word; pb: Pointer; cb: Word):Word;
  468.  
  469. {Conversion functions}
  470.  
  471. function vbYPixelsToTwips(Pixels: Integer): Longint;
  472. function vbXPixelsToTwips(Pixels: Integer): Longint;
  473. function vbYTwipsToPixels(Twips: Longint):Integer;
  474. function vbXTwipsToPixels(Twips: Longint):Integer;
  475.  
  476.  
  477. {Ver 2.0 Functions}
  478.  
  479. function vbGetVersion: Word;
  480.  
  481. function vbSetControlFlags(Control: HCtl; mask: Longint; value: Longint ): Longint;
  482. function vbGetCapture: HCtl;
  483. procedure vbSetCapture(Control: HCtl );
  484. procedure vbReleaseCapture;
  485. procedure vbMoveControl(Control: HCtl; var Rect: TRect ; fRepaint: BOOL );
  486. procedure vbGetControlRect(Control: HCtl ;var Rect: TRect );
  487. procedure vbGetRectInContainer(Control: HCtl ;var Rect: TRect );
  488. procedure vbGetClientRect(Control: HCtl ;var Rect: TRect );
  489. procedure vbClientToScreen(Control: HCtl ;var Point: TPoint );
  490. procedure vbScreenToClient(Control: HCtl;var Point: TPoint );
  491. function vbIsControlVisible(Control: HCtl ): BOOL;
  492. function vbIsControlEnabled(Control: HCtl ): BOOL;
  493. procedure vbInvalidateRect(Control: HCtl ;var Rect: TRect ; fEraseBkGnd: BOOL );
  494. procedure vbUpdateControl(Control: HCtl );
  495.  
  496. function vbGetControl(Control: HCtl ; gc: WORD ): HCtl;
  497. CONST
  498.     gc_FIRSTSIBLING       =$0000;
  499.     gc_LASTSIBLING          =$0001;
  500.     gc_NEXTSIBLING          =$0002;
  501.     gc_PREVSIBLING          =$0003;
  502.     gc_CHILD          =$0005;
  503.     gc_CONTAINER          =$1000;
  504.     gc_FORM           =$1001;
  505.     gc_FIRSTCONTROL       =$1002;
  506.     gc_NEXTCONTROL          =$1003;
  507.     gc_FIRSTSELECTED      =$1004;
  508.     gc_NEXTSELECTED       =$1005;
  509.  
  510. procedure vbZOrder(Control: HCtl ; zorder: WORD );
  511. CONST
  512.     zorder_Front    =0;
  513.     zorder_Back     =1;
  514. function vbCreateTempHlstr(pb: Pointer ; cbLen: Word ): HLStr;
  515. function vbDerefHlstrLen(HStr: HLStr ;var pCbLen: Word ): LPStr;
  516. function vbDerefZeroTermHlstr(HStr: HLStr ): LPStr;
  517. function vbGetHlstr(HStr: HLStr ; pb: Pointer ; cbLen: Word ): Word;
  518. function vbResizeHlstr(HStr: HLStr ; newCbLen: Word ): Word;
  519.  
  520. {Management of language Variant data TYPE}
  521.  
  522. function vbCoerceVariant(Variant: PVariant ; vtype: Integer ; lpData: Pointer ): Word;
  523. function vbGetVariantType(Variant: PVariant ): Integer;
  524. function vbGetVariantValue(Variant: PVariant ; Value: PValue ): Integer;
  525. function vbSetVariantValue(Variant: PVariant ; vtype: Integer ; lpData: Pointer ): Word;
  526.  
  527. {Management of language arrays}
  528.  
  529.   function loBound(x :Longint):Word;
  530.   function hiBound(x :Longint):Word;
  531.  
  532. function vbArrayElement(VBArray: HAD ; cIndex: Integer ;var lpi: Integer ): Pointer;
  533. CONST
  534.     ab_INVALIDINDEX     =1;      {hAD or index is bad}
  535. function vbArrayBounds(VBArray: HAD ; index: Integer ): Longint;
  536. function vbArrayElemSize(VBArray: HAD ): Word;
  537. function vbArrayFirstElem(VBArray: HAD ): Pointer;
  538. function vbArrayIndexCount(VBArray: HAD ): Integer;
  539.  
  540. {VB Error routines}
  541.  
  542. procedure vbRuntimeError(err: Word );
  543.  
  544. {Floating-point stack save/restore utilities}
  545. function vbCbSaveFPState(pb: Pointer ; cb: Word ): Word;
  546. procedure vbRestoreFPState(pb: Pointer );
  547.  
  548. {Picture functions}
  549. function vbAllocPicEx(PntPic: PPIC ; usVersion: Word ): HPic;
  550. function vbGetPicEx(Pic: HPic ; PntPic: PPIC ; usVersion: Word ): HPic;
  551. procedure vbPaletteChanged(Control: HCtl );
  552. function vbTranslateColor(Control: HCtl ; Color: Longint ): Longint;
  553.  
  554. {Link Interface functions}
  555.  
  556. function vbLinkPostAdvise(Control: HCtl ): Word;
  557. function vbPasteLinkOk(var phTriplet: THANDLE ; Control: HCtl ): BOOL;
  558.  
  559. {Misc functions}
  560. function vbFormat(vtype: Integer ; lpData: Pointer ; lpszFmt: LPStr ;
  561.                     pb: Pointer ; cb: Word ): Integer;
  562.  
  563. CONST
  564. {Visual Basic messages}
  565.     vbm__BASE       =    (wm_User + $0C00);
  566.  
  567. {All properties have been loaded.  Must set model_fLoadMsg to receive.}
  568.     vbm_CREATED       =    (vbm__Base + $00);
  569.  
  570. {Form load is complete or dynamic control is fully loaded.  Must set}
  571. {model_fLoadMsg to receive.}
  572.     vbm_LOADED       =    (vbm__Base + $01);
  573.  
  574. {Pre-hwnd properties are not yet loaded (no hwnd exists for control yet).}
  575. {Must set model_fInitMsg to receive.}
  576.     vbm_INITIALIZE       =    (vbm__Base + $02);
  577.  
  578. {Get a property value.}
  579. {[wp=iprop, lp=pdata], RetVal=ERR}
  580.     vbm_GETPROPERTY    =    (vbm__Base + $03);
  581.  
  582. {Verify a property value.}
  583. {[wp=iprop, lp=data], RetVal=ERR}
  584.     vbm_CHECKPROPERTY  =    (vbm__Base + $04);
  585.  
  586. {Set a property value.}
  587. {[wp=iprop, lp=data], RetVal=ERR}
  588.     vbm_SETPROPERTY    =    (vbm__Base + $05);
  589.  
  590. {Write a property.}
  591. {[wp=iprop, lp=pfileref], RetVal=ERR}
  592.     vbm_SAVEPROPERTY   =    (vbm__Base + $06);
  593.  
  594. {Read a property.}
  595. {[wp=iprop, lp=pfileref], RetVal=ERR}
  596.     vbm_LOADPROPERTY   =    (vbm__Base + $07);
  597.  
  598. {Get the string representation of a property.}
  599. {[wp=iprop, lp=HSZ FAR *], RetVal=ERR}
  600.     vbm_GETPROPERTYHSZ =    (vbm__Base + $08);
  601.  
  602. {Create popup window used to change a property.}
  603. {[wp=iprop, lp=listbox hwnd], RetVal=popup hwnd}
  604.     vbm_INITPROPPOPUP  =    (vbm__Base + $09);
  605.  
  606. {Determine if Paste/PasteLink is allowed.}
  607. {[wp=PASTETYPE], RetVal=BOOL}
  608.     vbm_QPASTEOK       =    (vbm__Base + $0A);
  609.  
  610.     PT_PASTE    =0;
  611.     PT_PASTELINK    =1;
  612.  
  613. {Paste control-specific data from the clipboard.}
  614. {[wp=PASTETYPE], RetVal=ERR}
  615.     vbm_PASTE       =    (vbm__Base + $0B);
  616.  
  617. {Copy control specific data to the clipboard.}
  618.     vbm_COPY       =    (vbm__Base + $0C);
  619.  
  620. {Control activated upon receipt of a unique mnemonic key.}
  621.     vbm_MNEMONIC       =    (vbm__Base + $0D);
  622.  
  623. {Posted to fire a deferred event.}
  624. {[wp=event]}
  625.     vbm_FIREEVENT       =    (vbm__Base + $0E);
  626.  
  627. {Another control in drag mode drug over the control.}
  628. {[lp=pdraginfo]}
  629.     vbm_DRAGOVER       =    (vbm__Base + $0F);
  630.  
  631. {This message is sent to a control that has just had another control}
  632. {in drag mode dropped on it.}
  633. {[lp=pdraginfo]}
  634.     vbm_DRAGDROP       =    (vbm__Base + $10);
  635.  
  636. {This message is sent when certain methods are invoked on controls}
  637. {[wp=meth_, lp=far *alParams], RetVal=ERR}
  638.     vbm_METHOD       =    (vbm__Base + $11);
  639.  
  640.     meth_ADDITEM    =    $0001 ;{     args are: cArgs, hszItem, [index]}
  641.     meth_REMOVEITEM =    $0002 ;{     args are: cArgs, index}
  642.     meth_REFRESH    =    $0003 ;{     no args (lp == NULL)}
  643.     meth_MOVE    =    $0004 ;{     args are: cArgs, left, [top, [width, [height]]]}
  644.     meth_DRAG    =    $0005 ;{     args are: cArgs, [cmd]}
  645.     meth_LINKSEND   =    $0006;{  no args (lp == NULL)}
  646.     meth_ZORDER    =    $0007 ;{     args are: cArgs, pos}
  647.     meth_CLEAR    =    $000A ;{     no args (lp == NULL)}
  648.  
  649. {Clear capture and internal state.}
  650.     vbm_CANCELMODE       =    (vbm__Base + $12);
  651.  
  652. {Paint notification for graphical controls.}
  653. {[wp=hdc, lp=lprect]}
  654.     vbm_PAINT       =    (vbm__Base + $14);
  655.  
  656. {Hit test for graphical controls.}
  657. {[lp=lphittest], RetVal = ht_}
  658.     vbm_HITTEST       =    (vbm__Base + $15);
  659.  
  660.     ht_ON          =7;
  661.     ht_SOLID_NEAR      =6;
  662.     ht_PATTERN_NEAR   =5;
  663.     ht_HOLLOW_NEAR      =4;
  664.     ht_SOLID      =3;
  665.     ht_PATTERN      =2;
  666.     ht_HOLLOW      =1;
  667.     ht_MISS       =0;
  668.  
  669.  
  670. TYPE
  671.     LPHitTest = ^THitTest;
  672.     THitTest = RECORD
  673.         pt:    TPoint;
  674.         rect:    TRect;
  675.     END;
  676.  
  677. CONST
  678. {Paint the multi-select handles}
  679. {[wp=hdc, lp=rect(in hdc coords)]}
  680.     vbm_PAINTMULTISEL  =    (vbm__Base + $16);
  681.  
  682. {Paint the "gray rect" or ctl outline while moving/sizing ctl.}
  683. {[wp=hdc, lp=rect(in hdc coords)]}
  684.     vbm_PAINTOUTLINE   =    (vbm__Base + $17);
  685.  
  686. {Palette change notification.}
  687. {[wp=fPalBack(for SelectPalette)], RetVal = return from RealizePalette}
  688.     vbm_PALETTECHANGED =    (vbm__Base + $1B);
  689.  
  690. {Get control palette.}
  691. {RetVal = HPALETTE.}
  692.     vbm_GETPALETTE       =    (vbm__Base + $1C);
  693.  
  694. {Enumerate available formats.}
  695. {[wp=SUPPLIESDATAFORMAT or ACCEPTSDATAFORMAT]}
  696. {[LOWORD(lp)=ennumeration(0-x)]}
  697.     vbm_LINKENUMFORMATS=    (vbm__Base + $1E);
  698.  
  699. {Ask a control for it's LINK item name.  Return item name as lpsz in lp.}
  700. {[wp=LINKSRCASK or LINKSRCTELL]}
  701. {[lp=lpszItemName]}
  702.     vbm_LINKGETITEMNAME=    (vbm__Base + $1F);
  703.  
  704. {For Server items and client pokes.}
  705. {[wp=wFormat lp=LPLINKDATA]}
  706.     vbm_LINKGETDATA    =    (vbm__Base + $20);
  707.  
  708. {Used in client requests, advises, and server pokes.}
  709. {[wp=wFormat lp=LPLINKDATA]}
  710.     vbm_LINKSETDATA    =    (vbm__Base + $21);
  711.  
  712. {Get help on property or event name.}
  713. {[LOBYTE(wp)=vbhelp_, HIBYTE(wp)=iprop/ievent, lp=lpmodel]}
  714.     vbm_HELP        =    (vbm__Base + $22);
  715.  
  716.     vbhelp_PROP        =    $0001;
  717.     vbhelp_EVT        =    $0002;
  718.     vbhelp_CTL        =    $0003;
  719.  
  720. {Get default size of control}
  721. {LOWORD(RetVal)=cx, HIWORD(RetVal)=cy}
  722.     vbm_GETDEFSIZE       =    (vbm__Base + $23);
  723.  
  724. {Just like vbm_SAVE(LOAD)PROPERTY, but saves (loads) as text.}
  725.     vbm_SAVETEXTPROPERTY   =    (vbm__Base + $24);
  726.     vbm_LOADTEXTPROPERTY   =    (vbm__Base + $25);
  727.  
  728. {Is char a mnemonic for this control?}
  729. {[wp=char] RetVal=TRUE/FALSE}
  730.     vbm_ISMNEMONIC       =    (vbm__Base + $26);
  731.  
  732. {Does control want to see wm_KEYUP/wm_KEYDOWN for vk?  Sent only}
  733. {for keys which are normally trapped by VB.  E.g. Tab, Enter, etc.}
  734. {[wp=vk] RetVal=TRUE/FALSE}
  735.     vbm_WANTSPECIALKEY =    (vbm__Base + $27);
  736.  
  737. {Notifies a control that it has been selected in the property window.}
  738. {[wp=multiselect ON (TRUE) or OFF (FALSE)]}
  739. {[LOWORD(lp)=multiselect count (0 first, n last)]}
  740.     vbm_SELECTED       =    (vbm__Base + $28);
  741.  
  742. {Bound control interface}
  743.     vbm_DATA_INITIATE =    (vbm__Base + $29);
  744.     vbm_DATA_TERMINATE=    (vbm__Base + $2A);
  745.  
  746.     vbm_DATA_AVAILABLE=    (vbm__Base + $2B);
  747.     vbm_DATA_GET      =    (vbm__Base + $2C);
  748.     vbm_DATA_REQUEST  =    (vbm__Base + $2D);
  749.     vbm_DATA_SET      =    (vbm__Base + $2E);
  750.     vbm_DATA_METHOD   =    (vbm__Base + $2F);
  751.  
  752.  
  753. {Notifications reflected back to control from parent.}
  754.     vbn__BASE            =    (vbm__Base + $1000);
  755.  
  756.     vbn_COMMAND            =    (vbn__BASE + wm_COMMAND);
  757.     vbn_CTLCOLOR        =    (vbn__BASE + wm_CTLCOLOR);
  758.     vbn_DRAWITEM        =    (vbn__BASE + wm_DRAWITEM);
  759.     vbn_MEASUREITEM     =    (vbn__BASE + wm_MEASUREITEM);
  760.     vbn_DELETEITEM        =    (vbn__BASE + wm_DELETEITEM);
  761.     vbn_VKEYTOITEM        =    (vbn__BASE + wm_VKEYTOITEM);
  762.     vbn_CHARTOITEM        =    (vbn__BASE + wm_CHARTOITEM);
  763.     vbn_COMPAREITEM     =    (vbn__BASE + wm_COMPAREITEM);
  764.     vbn_HSCROLL            =    (vbn__BASE + wm_HSCROLL);
  765.     vbn_VSCROLL            =    (vbn__BASE + wm_VSCROLL);
  766.     vbn_PARENTNOTIFY    =    (vbn__BASE + wm_PARENTNOTIFY);
  767.  
  768. {Data xfer structure for vbm_LINKGETDATA or vbm_LINKSETDATA}
  769. TYPE
  770.     LPLinkData = ^TVBLinkData;
  771.     tVBLinkData = RECORD
  772.         wReserved  :Word;
  773.         cb         :Longint;
  774.         HData      :THandle;
  775.         dwReserved :Longint;
  776.     END;
  777.  
  778. {Link modes}
  779. CONST
  780.     LINKMODENONE            =0;
  781.     LINKMODEAUTO            =1;
  782.     LINKMODEMANUAL            =2;
  783.     LINKMODENOTIFY                  =3;
  784.  
  785.     LINKMODESERVERPOKE        =1;
  786.     LINKMODESERVERNOPOKE        =2;
  787.  
  788. TYPE
  789.     VBDDEDATA     =    TVBLINKDATA;
  790.     LPDDEDATA     =    LPLINKDATA;
  791.  
  792. {Misc DDE defines}
  793. CONST
  794.     MAX_EXEC                 = 256;
  795.     MAXLINKITEMNAME          = 256;
  796.  
  797.     ACCEPTSDATAFORMAT        = 1;
  798.     SUPPLIESDATAFORMAT       = 2;
  799.  
  800.     LINKSRCASK               = 0;
  801.     LINKSRCTELL              = 1;
  802.  
  803.     link_DATA_OK             = 0;
  804.     link_DATA_OOM             = 1;
  805.     link_DATA_FORMATBAD         = 2;
  806.     link_DATA_SETFAILED         = 3;
  807.  
  808. {       Attempted to Initate on a channel that had linkmode set to None.}
  809.     errInitOnNonServerDesk   = 6;
  810.  
  811. {The Server Channel array is filled.}
  812.     errAllServerChUsed       = 7;
  813.  
  814. {The Set quality failed possible string too long.}
  815.     errDataSettingFailed     = 8;
  816.  
  817.     errOutOfMemoryForLink    = 11;
  818.  
  819.  
  820.  
  821. { Standard control properties}
  822. CONST iprop_Std_NAME            = $0000;
  823.       iprop_Std_CTLNAME            = iprop_Std_NAME;
  824.       iprop_Std_INDEX             = $0001;
  825.       iprop_Std_HWND            = $0002;
  826.       iprop_Std_BACKCOLOR        = $0003;
  827.       iprop_Std_FORECOLOR        = $0004;
  828.       iprop_Std_LEFT            = $0005;
  829.       iprop_Std_TOP                = $0006;
  830.       iprop_Std_WIDTH             = $0007;
  831.       iprop_Std_HEIGHT            = $0008;
  832.       iprop_Std_ENABLED            = $0009;
  833.       iprop_Std_VISIBLE            = $000A;
  834.       iprop_Std_MOUSEPOINTER    = $000B;
  835.       iprop_Std_CAPTION            = $000C;
  836.       iprop_Std_FONTNAME        = $000D;
  837.       iprop_Std_FONTBOLD        = $000E;
  838.       iprop_Std_FONTITALIC        = $000F;
  839.       iprop_Std_FONTSTRIKE        = $0010;
  840.       iprop_Std_FONTUNDER        = $0011;
  841.       iprop_Std_FONTSIZE        = $0012;
  842.       iprop_Std_TABINDEX        = $0013;
  843.       iprop_Std_PARENT            = $0014;
  844.       iprop_Std_DRAGMODE        = $0015;
  845.       iprop_Std_DRAGICON        = $0016;
  846.       iprop_Std_BORDERSTYLEOFF  = $0017;
  847.       iprop_Std_TABSTOP            = $0018;
  848.       iprop_Std_TAG                = $0019;
  849.       iprop_Std_TEXT            = $001B;
  850.       iprop_Std_BORDERSTYLEON   = $001C;
  851.       iprop_Std_CLIPCONTROLS    = $001D;
  852.       iprop_Std_NONE            = $001E;
  853.       iprop_Std_HELPCONTEXTID   = $001F;
  854.       iprop_Std_LINKMODE        = $0020;
  855.       iprop_Std_LINKITEM        = $0021;
  856.       iprop_Std_LINKTOPIC        = $0022;
  857.       iprop_Std_LINKTIMEOUT        = $0023;
  858.       iprop_Std_LEFTNORUN        = $0024;
  859.       iprop_Std_TOPNORUN        = $0025;
  860.       iprop_Std_ALIGN             = $0026;
  861.       iprop_Std_IMEMODE            = $0027;
  862.       iprop_Std_DATASOURCE        = $0028;
  863.       iprop_Std_DATAFIELD        = $0029;
  864.       iprop_Std_DATACHANGED        = $002A;
  865.       iprop_Std_LAST            = $0FFF;
  866.  
  867.       ppropinfo_Std_NAME            = OfsPPROPINFO (not iprop_Std_NAME);
  868.       ppropinfo_Std_CTLNAME            = OfsPPROPINFO (not iprop_Std_NAME);
  869.       ppropinfo_Std_INDEX            = OfsPPROPINFO (not iprop_Std_INDEX);
  870.       ppropinfo_Std_HWND            = OfsPPROPINFO (not iprop_Std_HWND);
  871.       ppropinfo_Std_BACKCOLOR       = OfsPPROPINFO (not iprop_Std_BACKCOLOR);
  872.       ppropinfo_Std_FORECOLOR       = OfsPPROPINFO (not iprop_Std_FORECOLOR);
  873.       ppropinfo_Std_LEFT            = OfsPPROPINFO (not iprop_Std_LEFT);
  874.       ppropinfo_Std_TOP                = OfsPPROPINFO (not iprop_Std_TOP);
  875.       ppropinfo_Std_WIDTH            = OfsPPROPINFO (not iprop_Std_WIDTH);
  876.       ppropinfo_Std_HEIGHT            = OfsPPROPINFO (not iprop_Std_HEIGHT);
  877.       ppropinfo_Std_ENABLED            = OfsPPROPINFO (not iprop_Std_ENABLED);
  878.       ppropinfo_Std_VISIBLE            = OfsPPROPINFO (not iprop_Std_VISIBLE);
  879.       ppropinfo_Std_MOUSEPOINTER    = OfsPPROPINFO (not iprop_Std_MOUSEPOINTER);
  880.       ppropinfo_Std_CAPTION            = OfsPPROPINFO (not iprop_Std_CAPTION);
  881.       ppropinfo_Std_FONTNAME        = OfsPPROPINFO (not iprop_Std_FONTNAME);
  882.       ppropinfo_Std_FONTBOLD        = OfsPPROPINFO (not iprop_Std_FONTBOLD);
  883.       ppropinfo_Std_FONTITALIC      = OfsPPROPINFO (not iprop_Std_FONTITALIC);
  884.       ppropinfo_Std_FONTSTRIKE      = OfsPPROPINFO (not iprop_Std_FONTSTRIKE);
  885.       ppropinfo_Std_FONTUNDER       = OfsPPROPINFO (not iprop_Std_FONTUNDER);
  886.       ppropinfo_Std_FONTSIZE        = OfsPPROPINFO (not iprop_Std_FONTSIZE);
  887.       ppropinfo_Std_TABINDEX        = OfsPPROPINFO (not iprop_Std_TABINDEX);
  888.       ppropinfo_Std_PARENT            = OfsPPROPINFO (not iprop_Std_PARENT);
  889.       ppropinfo_Std_DRAGMODE        = OfsPPROPINFO (not iprop_Std_DRAGMODE);
  890.       ppropinfo_Std_DRAGICON        = OfsPPROPINFO (not iprop_Std_DRAGICON);
  891.       ppropinfo_Std_BORDERSTYLEOFF  = OfsPPROPINFO (not iprop_Std_BORDERSTYLEOFF);
  892.       ppropinfo_Std_TABSTOP            = OfsPPROPINFO (not iprop_Std_TABSTOP);
  893.       ppropinfo_Std_TAG                = OfsPPROPINFO (not iprop_Std_TAG);
  894.       ppropinfo_Std_TEXT            = OfsPPROPINFO (not iprop_Std_TEXT);
  895.       ppropinfo_Std_BORDERSTYLEON   = OfsPPROPINFO (not iprop_Std_BORDERSTYLEON);
  896.       ppropinfo_Std_CLIPCONTROLS    = OfsPPROPINFO (not iprop_Std_CLIPCONTROLS);
  897.       ppropinfo_Std_NONE            = OfsPPROPINFO (not iprop_Std_NONE);
  898.       ppropinfo_Std_HELPCONTEXTID   = OfsPPROPINFO (not iprop_Std_HELPCONTEXTID);
  899.       ppropinfo_Std_LINKMODE        = OfsPPROPINFO (not iprop_Std_LINKMODE);
  900.       ppropinfo_Std_LINKITEM        = OfsPPROPINFO (not iprop_Std_LINKITEM);
  901.       ppropinfo_Std_LINKTOPIC       = OfsPPROPINFO (not iprop_Std_LINKTOPIC);
  902.       ppropinfo_Std_LINKTIMEOUT     = OfsPPROPINFO (not iprop_Std_LINKTIMEOUT);
  903.       ppropinfo_Std_LEFTNORUN       = OfsPPROPINFO (not iprop_Std_LEFTNORUN);
  904.       ppropinfo_Std_TOPNORUN        = OfsPPROPINFO (not iprop_Std_TOPNORUN);
  905.       ppropinfo_Std_ALIGN            = OfsPPROPINFO (not iprop_Std_ALIGN);
  906.       ppropinfo_Std_IMEMODE            = OfsPPROPINFO (not iprop_Std_IMEMODE);
  907.       ppropinfo_Std_DATASOURCE        = OfsPPROPINFO (not iprop_Std_DATASOURCE);
  908.       ppropinfo_Std_DATAFIELD        = OfsPPROPINFO (not iprop_Std_DATAFIELD);
  909.       ppropinfo_Std_DATACHANGED        = OfsPPROPINFO (not iprop_Std_DATACHANGED);
  910.       ppropinfo_Std_LAST            = OfsPPROPINFO (not iprop_Std_LAST);
  911.  
  912. {Standard control event list}
  913. CONST ievent_Std_CLICK        =  $0000;
  914.       ievent_Std_DBLCLICK    =  $0001;
  915.       ievent_Std_DRAGDROP    =  $0002;
  916.       ievent_Std_DRAGOVER    =  $0003;
  917.       ievent_Std_GOTFOCUS    =  $0004;
  918.       ievent_Std_KEYDOWN    =  $0005;
  919.       ievent_Std_KEYPRESS    =  $0006;
  920.       ievent_Std_KEYUP        =  $0007;
  921.       ievent_Std_LOSTFOCUS    =  $0008;
  922.       ievent_Std_MOUSEDOWN    =  $0009;
  923.       ievent_Std_MOUSEMOVE    =  $000A;
  924.       ievent_Std_MOUSEUP    =  $000B;
  925.       ievent_Std_LINKERROR  =  $000C;
  926.       ievent_Std_LINKOPEN   =  $000D;
  927.       ievent_Std_LINKCLOSE  =  $000E;
  928.       ievent_Std_LINKNOTIFY =  $000F;
  929.       ievent_Std_LINKCHANGE =  $0010;
  930.       ievent_Std_NONE         =  $0FFF;
  931.       ievent_Std_LAST         =  $0FFF;
  932.  
  933.  
  934. CONST
  935.     peventinfo_Std_CLICK        =OfsPEVENTINFO (not ievent_Std_CLICK);
  936.     peventinfo_Std_DBLCLICK     =OfsPEVENTINFO (not ievent_Std_DBLCLICK);
  937.     peventinfo_Std_DRAGDROP     =OfsPEVENTINFO (not ievent_Std_DRAGDROP);
  938.     peventinfo_Std_DRAGOVER     =OfsPEVENTINFO (not ievent_Std_DRAGOVER);
  939.     peventinfo_Std_GOTFOCUS     =OfsPEVENTINFO (not ievent_Std_GOTFOCUS);
  940.     peventinfo_Std_KEYDOWN        =OfsPEVENTINFO (not ievent_Std_KEYDOWN);
  941.     peventinfo_Std_KEYPRESS     =OfsPEVENTINFO (not ievent_Std_KEYPRESS);
  942.     peventinfo_Std_KEYUP        =OfsPEVENTINFO (not ievent_Std_KEYUP);
  943.     peventinfo_Std_LOSTFOCUS    =OfsPEVENTINFO (not ievent_Std_LOSTFOCUS);
  944.     peventinfo_Std_MOUSEDOWN    =OfsPEVENTINFO (not ievent_Std_MOUSEDOWN);
  945.     peventinfo_Std_MOUSEMOVE    =OfsPEVENTINFO (not ievent_Std_MOUSEMOVE);
  946.     peventinfo_Std_MOUSEUP        =OfsPEVENTINFO (not ievent_Std_MOUSEUP);
  947.     peventinfo_Std_LINKERROR    =OfsPEVENTINFO (not ievent_Std_LINKERROR);
  948.     peventinfo_Std_LINKOPEN        =OfsPEVENTINFO (not ievent_Std_LINKOPEN);
  949.     peventinfo_Std_LINKCLOSE    =OfsPEVENTINFO (not ievent_Std_LINKCLOSE);
  950.     peventinfo_Std_LINKNOTIFY   =OfsPEVENTINFO (not ievent_Std_LINKNOTIFY);
  951.     peventinfo_Std_LINKCHANGE   =OfsPEVENTINFO (not ievent_Std_LINKCHANGE);
  952.     peventinfo_Std_NONE            =OfsPEVENTINFO (not ievent_Std_NONE);
  953.     peventinfo_Std_LAST            =OfsPEVENTINFO (not ievent_Std_LAST);
  954.  
  955.  
  956. IMPLEMENTATION
  957.  
  958. function rgbColor(Color: Longint):Longint;
  959. begin
  960.    if (Color and color_DefBitOn) <> 0 then
  961.        rgbColor := GetSysColor(Color and $FFFF)
  962.    else
  963.       rgbColor := Color and $FFFFFF;
  964. end;
  965.  
  966. function loBound(x :Longint):Word;
  967. begin
  968.   loBound := loWord(x)
  969. end;
  970. function hiBound(x :Longint):Word;
  971. begin
  972.   hiBound := hiWord(x)
  973. end;
  974.  
  975. {$L VBAPI_.OBJ}
  976.  
  977. function vbGetMode;                        external;
  978. function vbDerefControl;                external;
  979. function vbDefControlProc;                external;
  980. function vbRegisterModel;                external;
  981. function vbGetControlHwnd;                external;
  982. function vbGetHInstance;                external;
  983. function vbGetControlModel;                external;
  984. function vbGetControlName;                external;
  985. function vbGetHwndControl;                external;
  986. function vbSendControlMsg;                external;
  987. function vbSuperControlProc;            external;
  988. function vbRecreateControlHwnd;            external;
  989. procedure vbDirtyForm;                    external;
  990. function vbSetErrorMessage;                external;
  991. procedure vbGetAppTitle;                external;
  992. function vbDialogBoxParam;                external;
  993. function vbCreateHsz;                    external;
  994. procedure vbDestroyHsz;                    external;
  995. function  VBDerefHsz;                    external;
  996. function  VBLockHsz;                    external;
  997. procedure vbUnlockHsz;                    external;
  998. function vbCreateHlstr;                    external;
  999. procedure vbDestroyHlstr;                external;
  1000. function vbDerefHlstr;                    external;
  1001. function vbGetHlstrLen;                    external;
  1002. function vbSetHlstr;                    external;
  1003. function vbFireEvent;                    external;
  1004. function vbGetControlProperty;            external;
  1005. function vbSetControlProperty;            external;
  1006. function vbAllocPic;                    external;
  1007. procedure vbFreePic;                    external;
  1008. function vbGetPic;                        external;
  1009. function vbPicFromCF;                    external;
  1010. function vbRefPic;                        external;
  1011. function vbReadFormFile;                external;
  1012. function vbWriteFormFile;                external;
  1013. function vbSeekFormFile;                external;
  1014. function vbRelSeekFormFile;                external;
  1015. function vbReadBasicFile;                external;
  1016. function vbWriteBasicFile;                external;
  1017. function vbYPixelsToTwips;                external;
  1018. function vbXPixelsToTwips;                external;
  1019. function vbYTwipsToPixels;                external;
  1020. function vbXTwipsToPixels;                external;
  1021. function  vbGetVersion;                    external;
  1022. function  vbSetControlFlags;            external;
  1023. function  vbGetCapture;                    external;
  1024. procedure vbSetCapture;                    external;
  1025. procedure vbReleaseCapture;                external;
  1026. procedure vbMoveControl;                external;
  1027. procedure vbGetControlRect;                external;
  1028. procedure vbGetRectInContainer;            external;
  1029. procedure vbGetClientRect;                external;
  1030. procedure vbClientToScreen;                external;
  1031. procedure vbScreenToClient;                external;
  1032. function  vbIsControlVisible;            external;
  1033. function  vbIsControlEnabled;            external;
  1034. procedure vbInvalidateRect;                external;
  1035. procedure vbUpdateControl;                external;
  1036. function  vbGetControl;                    external;
  1037. procedure vbZOrder;                        external;
  1038. function  vbCreateTempHlstr;            external;
  1039. function  vbDerefHlstrLen;                external;
  1040. function  vbDerefZeroTermHlstr;            external;
  1041. function  vbGetHlstr;                    external;
  1042. function  vbResizeHlstr;                external;
  1043. function  vbCoerceVariant;                external;
  1044. function  vbGetVariantType;                external;
  1045. function  vbGetVariantValue;            external;
  1046. function  vbSetVariantValue;            external;
  1047. function  vbArrayElement;                external;
  1048. function  vbArrayBounds;                external;
  1049. function  vbArrayElemSize;                external;
  1050. function  vbArrayFirstElem;                external;
  1051. function  vbArrayIndexCount;            external;
  1052. procedure vbRuntimeError;                external;
  1053. function  vbCbSaveFPState;                external;
  1054. procedure vbRestoreFPState;                external;
  1055. function  vbAllocPicEx;                    external;
  1056. function  vbGetPicEx;                    external;
  1057. procedure vbPaletteChanged;                external;
  1058. function  vbTranslateColor;                external;
  1059. function  vbLinkPostAdvise;                external;
  1060. function  vbPasteLinkOk;                external;
  1061. function  vbFormat;                        external;
  1062.  
  1063. END.
  1064.